<div class="pagenav">
	<a>演示</a> 
	<span class="pagenav-separator">/</span> 
	<a>反馈（请勿滥发，注重文明，谢谢。）</a>
</div>
<div class="layui-card">
	<div class="pagetools layui-clear">
		<div class="right-btns">
			<button class="layui-btn bg-forgive"  id="feedBackAddBtn" ><i class="iconfont icon-add"></i> 反馈</button>
		</div>
	</div>
		
	<div class="layui-card-body">
		<table id="feedBackTable" lay-filter="feedBackTableFilter"></table>
	</div>
</div>
<script type="text/html" id="feedBackTableTool">
  <a class="layui-btn layui-btn-xs" lay-event="view">查看</a>
</script>

<script type="text/javascript">
layui.use(["tablePage", "table", "admin"], function(){
	var admin = layui.admin;
	var table = layui.table;
	var TPage = layui.tablePage;
	var tpage = TPage.create("#feedBackTable", "/admin/feedback", {
		cols:[[			
			{field:'title',title:"标题"},
			{field:'content',title:"内容"},
			{title:"反馈时间", width:170, templet : function(d){
				return admin.utils.formatDateTime(d.create_time);
			}},
			{width:100, title:"操作", align:'center', toolbar: '#feedBackTableTool'}
		]]
	});
	tpage.load();
	
	table.on('tool(feedBackTableFilter)',function(obj){
		var data = obj.data
		var layEvent = obj.event; 
		 if(layEvent === 'view'){ //查看
			 admin.render("/demo/feedback/view", "dialog", {
				 title:"反馈详情",
				 p : data,
				 pageId: "feedBackViewPage",
				 maxmin:true,
				 max:true,
			 });
		 }
	});
	
	window.onRefresh = function(){
		tpage.load();
	}
	
	$("#feedBackAddBtn").click(function(){
		admin.render("/demo/feedback/edit", "dialog", {
			title:"提交反馈",
			area:["800px","530px"],
			pageId:"feedBackEditPage",
			end:function(isOk){
				isOk && tpage.load();
			}
		})
	});
	
})


</script>